/**
 * @file socket.h 
 *
 * @brief Socket management header file.
 *
 * @author Richard A Delorme
 * @date 1998 - 2011
 * @version 4.1
 */

#ifndef EDAX_SOCKET_H
#define EDAX_SOCKET_H

#if defined(__unix__) || defined(__APPLE__)

#include <stdio.h>
#include <sys/socket.h>

int socket_connect(const char *host, int port);
void socket_shutdown(int sock, int how);
int socket_read(int sock, char **buffer, int flag);
int socket_write(int sock, char *buffer, int flag);

int socket_option_get(int sock, int level, int option_name, void *option_value, socklen_t *option_length);
int socket_option_set(int sock, int level, int option_name, void *option_value, socklen_t option_length);
void socket_option_dump(int sock, FILE *f);

#endif /* __unix__ */

#endif /*EDAX_SOCKET_H */

